--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit fbef8e05c5fd8c0fadbb64c6ad1b8d18f2271ed9
Parents : f8baa55
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Signature : T66BB85Valid, signed by author
Date : 2026-07-21T02:16:52+02:00
Added ability to view own interface telemetry on map
Changes
Diff
diff --git a/sbapp/ui/map.py b/sbapp/ui/map.py
index d7efdda6..87fa4b0c 100644
--- a/sbapp/ui/map.py
+++ b/sbapp/ui/map.py
@@ -673,6 +673,35 @@ class Map():
self.app.own_appearance_changed = False
changes = True
+ if own_telemetry != None and "interfaces" in own_telemetry and own_telemetry["interfaces"] != None:
+ try:
+ own_interfaces = own_telemetry["interfaces"]["interfaces"]
+ for ifn in own_interfaces:
+ ife = own_interfaces[ifn]
+ ifts = own_telemetry["time"]["utc"]
+ discovery_hash = RNS.Identity.full_hash(own_address+ifn.encode("utf-8"))
+ if_appearance = self.app.iface_appearance(ife["type"])
+ if_appearance[1] = own_appearance[1]
+ if_appearance[2] = own_appearance[2]
+ config_entry = None
+ iface = { "name": ifn, "type": ife["type"], "transport": ife["transport"], "transport_id": ife["transport_id"], "network_id": ife["transport_id"],
+ "received": ifts, "last_heard": ifts, "stamp": None, "value": None, "hops": None, "heard_count": None,
+ "reachable_on": ife["reachable_on"], "port": ife["port"], "status": "available", "status_code": 1000,
+ "latitude": ife["lat"], "longitude": ife["lon"], "height": ife["height"], "if_appearance": if_appearance,
+ "frequency": ife["frequency"], "bandwidth": ife["bandwidth"], "channel": ife["channel"], "config_entry": config_entry,
+ "modulation": ife["modulation"], "cr": ife["codingrate"], "sf": ife["spreadingfactor"] }
+ self.interface_discovery_hashes[discovery_hash] = iface
+ self.app.telemetry_interfaces[discovery_hash] = iface
+ if iface["latitude"] and iface["longitude"]:
+ if not discovery_hash in self.clustered_markers:
+ telemetry = {"location": {"latitude": iface["latitude"], "longitude": iface["longitude"], "last_update": time.time()}}
+ marker = self.create_clustered_marker(discovery_hash, telemetry, if_appearance)
+ if marker != None:
+ self.clustered_markers[discovery_hash] = marker
+ changes = True
+
+ except Exception as e: RNS.log("Error while updating own interface markers: "+str(e), RNS.LOG_ERROR)
+
except Exception as e: RNS.log("Error while updating own map marker: "+str(e), RNS.LOG_ERROR)
try:
@@ -704,6 +733,7 @@ class Map():
if newest_timestamp <= marker.location_time: skip = True
latest_viewable = None
+ peer_interfaces = None
if not skip:
for telemetry_entry in sorted(telemetry_entries[telemetry_source], key=lambda t: t[0], reverse=True):
telemetry_timestamp = telemetry_entry[0]
@@ -711,6 +741,8 @@ class Map():
t = Telemeter.from_packed(telemetry_data)
if t != None:
telemetry = t.read_all()
+ if "interfaces" in telemetry and telemetry["interfaces"] != None:
+ if not peer_interfaces: peer_interfaces = telemetry["interfaces"]
if "location" in telemetry and telemetry["location"] != None and telemetry["location"]["latitude"] != None and telemetry["location"]["longitude"] != None:
latest_viewable = telemetry
break
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────